home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Development Platforms / Apple II / Essentials / Technical.Notes / IIGS / TN.IIGS.098 < prev    next >
Encoding:
Text File  |  1991-01-11  |  2.5 KB  |  52 lines  |  [TEXT/pdos]

  1. Apple II
  2. Technical Notes
  3. _____________________________________________________________________________
  4.                                                   Developer Technical Support
  5.  
  6. Apple IIgs
  7. #98:    Aren't Windows a Pane?
  8.  
  9. Written by:    Dave Lyons                                        January 1991
  10.  
  11. This Technical Note describes things in the Window Manager that we have to tell
  12. you even though we shouldn't.
  13. _____________________________________________________________________________
  14.  
  15.  
  16. A Warning About Window Color Table Handles And Resources
  17.  
  18. All versions of the Window Manager that support window color tables specified as
  19. handles or resources, up to and including System Software 5.0.4, work unreliably
  20. when a standard window's color table is supplied by handle or resource ID.
  21.  
  22. The problem is not immediately obvious; only one bit of memory is accidentally
  23. cleared, but the address is unpredictable in advance.  (When unlocking the color
  24. table handle, the standard window definition procedure attempts to unlock the
  25. handle manually by turning off bit 15 of word offset +4 in the master pointer
  26. record.  But it gets the high and low words of the handle reversed and usually
  27. turns off bit 15 of the word at offset $80E4 or $80E5 in some bank of RAM
  28. determined by the low byte of the handle.)
  29.  
  30. The solution is to avoid supplying color table handles or resource IDs to the
  31. Window Manager.  Supply color table pointers instead. You can get a color table
  32. pointer from a color table resource ID by calling LoadResource on the color
  33. table resource, locking the handle and dereferencing it.  Memory is less
  34. fragmented if color table resources used in this way are marked as attrFixed.
  35.  
  36. One method is to put the window color table pointer into the window template
  37. before calling NewWindow2.  If you are creating the window from an rWindParam1
  38. resource, you need to use LoadResource to get the template into RAM so that you
  39. can stuff the color table pointer into the template.  (Be sure to change the
  40. moreFlags field to indicate that the color table is a pointer, if the template
  41. indicates it's a resource.)  After you create the window with NewWindow2 (by
  42. handle), use ReleaseResource to release the rWindParam1 resource.
  43.  
  44. Another method is to create the window as invisible and pass the window color
  45. table pointer to SetFrameColor before calling ShowWindow.
  46.  
  47.  
  48. Further Reference
  49. _____________________________________________________________________________
  50.   o     Apple IIgs Toolbox Reference, Volumes 2-3
  51.  
  52.